<h1>Listing categories</h1>

<table class="table table-striped table-bordered table-hover">
  <thead>
    <tr>
      <th>Name</th>
      <th>Tags</th>
      <th>img</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @categories.each do |category| %>
      <tr>
        <td><%= category.name %></td>
        <td><%= category.tags %></td>
        <td><%= image_tag(category.cover) if category.cover.present? %></td>
        <td><%= link_to 'Show', [:admin, category] %></td>
        <td><%= link_to 'Edit', edit_admin_category_path(category) %></td>
        <td><%= link_to 'Destroy', [:admin, category], method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Category', new_admin_category_path %>
